import { randStr } from "../../utils";

export const KubeHudDomain = "kubehud.io";

// 内置元数据label key
export enum InjectLabelKey {
  AppName = "appName",
  Alias = "appAlias", // 别名
  Hostname = "kubernetes.io/hostname", // 主机名
  NodeRole = "node-role.kubernetes.io"
}

export enum PresetAnnotationKey {
  Alias = "mark.k8s.io/alias", // 别名
  Revision = "deployment.kubernetes.io/revision", // 部署版本
  DefaultStorageClass = "storageclass.kubernetes.io/is-default-class", //默认存储类
  ImagePullSecret = "dev.kubehud.io/imagePullSecret"
}

export const RestartSourceOperation = {
  spec: {
    template: {
      metadata: {
        annotations: {
          "kubectl.kubernetes.io/restartedAt": new Date()
        }
      }
    }
  }
};

export enum SecretDataKey {
  DockerConfigJson = ".dockerconfigjson",
  TlsCrt = "tls.crt",
  TlsKey = "tls.key",
  Privatekey = "ssh-privatekey",
  Publickey = "ssh-publickey"
}

export const randVolumeName = () => "volume-" + randStr(5);
export const randContainerName = () => "container-" + randStr(5);
